package fr.channel.client.event;

import com.google.web.bindery.event.shared.Event;

public class MessageEvent extends Event<MessageHandler> {

	private static final Type<MessageHandler> TYPE = new Type<MessageHandler>();

	protected String message;
	
	public MessageEvent(String message) {
		this.message = message;
	}
	
	public String getMessage() {
		return message;
	}
	
	@Override
	public Event.Type<MessageHandler> getAssociatedType() {
		return TYPE;
	}

	@Override
	protected void dispatch(MessageHandler handler) {
		handler.onNewMessage(this);
	}

}
